<#include "../common/header.htm">
<div class="content-wrapper">
	<section class="content-header">
		<ol class="breadcrumb">
			<li><a href="${ctx}/">首页</a></li>
			<li class="active"><a href="${ctx}/feedBack/form">新增反馈</a></li>
		</ol>
	</section>
	<section class="content">
        <h4 style="padding: 20px 0;border-bottom: 1px solid #e5e5e5">基本信息：</h4>   
        <div class="basic-info-wrapper">
			<div class="right-box" style="padding:10px 17px;">
				<dl>
					<dt style="color: #3c8dbc"><strong>问题反馈处理流程：</strong></dt>
					<dd>1、<span style="color: #3c8dbc;">提交：</span>提交新的问题或建议</dd>
					<dd>2、<span style="color: #3c8dbc;">确认：</span>问题/建议 详情确认</dd>
					<dd>3、<span style="color: #3c8dbc;">处理：</span>问题/建议 处理</dd>
					<dd>4、<span style="color: #3c8dbc;">完成：</span>问题/建议 提交处理结果</dd>
					<dd>5、<span style="color: #3c8dbc;">结束：</span>发起人确认并结束反馈</dd>
				</dl>
			</div>
			<form action="${ctx}/feedBack/form" method="post" enctype="multipart/form-data" class="left-box" id="feedBackForm">
					<input type="hidden" name="id" value="${feedBack.id!}" />
					<input type="hidden" name="userType" value="${userType}" />
					<div class="form-group form-inline row">
						<label class="input_text"><span style="color: red">* </span>标题：</label> 
						<input class="form-control" type="text" id="formTitle" name="title" value="${feedBack.title!}" style="width: 320px;" placeholder="请输入反馈标题" maxlength="40" unContainEscapeChar="true" required />
					</div>
					<div class="form-group form-inline row">
						<label class="input_text"><span style="color: red">* </span>类型：</label> 
						<select class="form-control" style="width: 200px;" name="feedBackParentType" >
							<option value="">请选择</option>
							<#list parentTypeMap as key, value>
								<option value="${key}">${value}</option>
							</#list>
						</select>
						<select class="form-control" style="width: 200px;" name="feedbackType" required >
							<option value="">请选择</option>
						</select>
					</div>
					<div class="form-group form-inline row receive-people">
					    <label class="input_text">
					    <span style="color: red">* </span>接收人：</label>
					    <#include "../workform/include/receiver.htm">
					</div>
					<div class="form-group form-inline row">
							<label class="input_text">备注：</label>
		                    <textarea class="form-control" rows="3" name="remark" style="width:400px;max-width:600px;max-height: 600px;"  placeholder="请输入其他需要说明的内容"  maxlength="1000" >${feedBack.remark!}</textarea>
					</div>
				    <div class="form-group form-inline row">
						 <label for="exampleInputFile" class="input_text">附件：</label>
	                     <input type="file" name="fileupload" style="display: inline-block;" multiple="multiple" fileMaxSize="1024 * 1024 * 20"
	                     	accept=".jpg,.jpeg,.png,.txt,.doc,.docx,.xls,.xlsx"
	                     	/>
					</div>
					
					<div style="margin: 30px 60px;">
						<button type="submit" class="btn btn-info">提交</button>&nbsp;&nbsp;
 						<button type="reset" class="btn btn-default" onclick="myReset();">清空</button>
					</div>
			</form>
		</div>
	</section>
</div>
<script type="text/javascript">
	<#if alertMessage??>
		bootbox.alert("${alertMessage}");
	</#if>

	/* 可输可选 */
	$('.select2').select2();
	
	/* 接收人切换 */
	$("select[name='receiverId']").change(function () {
		var options = $(this).find('option:selected').text();
		var arr = options.split("-");
		$("#receiverName").val(arr[1]);
		$(this).valid();
	});
	/* 反馈子类型 */
	var subType = {
		<#list subTypeMap as k, v>
			"${k}": "${v}",
		</#list>
	};
	/* 反馈父类型切换 */
	$("select[name='feedBackParentType']").change(function() {
		$("select[name='feedbackType']").html('<option value="">请选择</option>');
		var parentType = $(this).val();
		if (parentType) {
			for (key in subType) {
				if (key.substring(0,key.indexOf('_')) == parentType) {
					$("select[name='feedbackType']").append('<option value="' + key + '">' + subType[key] + '</option>');
				}
			}
		}		
	});
	
	// 表单重置
	function myReset() {
		$("#feedBackForm")[0].reset();
		$("#receiverName").val("");
		$(".select2-selection__rendered").attr("title", "请选择");
		$(".select2-selection__rendered").text("请选择");
	}
</script>
<#include "../common/footer.htm">
